<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="/Public/css/global.css" />
    <link href="/Public/css/style.css" rel="stylesheet" type="text/css" />
    <script src="/Public/js/jquery-1.10.2.min.js"></script>
    <script src="/Public/js/jquery.min.js"></script>
    <script src="/Public/js/amazeui.min.js"></script>
    <script>
        function realname()
        {
            var register_name= document.getElementById("register_name").value;
            var certificate= document.getElementById("certificate").value;

            if(register_name=="")
            {
                alert("真实姓名不能为空！");
                document.getElementById("register_name").focus();
                return false;
            }else if(!(/^[\u4e00-\u9fa5]{2,4}$/.test(register_name)))
            {
                alert("请输入真实姓名！");
                document.getElementById("register_name").focus();
                return false;
            }else if (certificate == "")
            {
                alert("身份证号不能为空！");
                document.getElementById("certificate").focus();
                return false;
            } else if (certificate.length < 18 || certificate.length > 18)
            {
                alert("请输入18位身份证号！");
                document.getElementById("certificate").focus();
                return false;
            }
        }
        //验证身份证的合法性
        $(function(){
            $("#certificate").blur(function() {
                var id_number = document.getElementById("certificate").value;
                $.ajax({
                    type:"post",
                    url:"/index.php/Home/wei/checkid",
                    data:{'certificate':certificate},
                    dataType:"json",
                    success:function(msg){
                        if(msg==2){
                            alert("请输入合法的身份证！");
                            $("#submit").attr("disabled",true);
                        }
                    }
                });
            });
        });

    </script>
</head>
<body>
<header id="title">
    <div class="back"><a  href="javascript:void(0)" onclick="javascript:history.go(-1);return false;" ></a>  </div>
    实名认证
</header>
<div style="height:40px;"></div>
<form method="post" action="/index.php/Home/member/register/id/{$id}">
<!--提现-->
<div class="pay-iphone">为了您的账户安全，请先进行实名认证</div>

<ul class="product_sq" style="margin-top:10px;">
    <li> <span>姓名</span>
        <input type="text" id="register_name" name="register_name" class="add-input" placeholder="请输入真实姓名">
    </li>
    <li style="border:0px"> <span>身份证号</span>
        <input type="password" id="certificate" name="certificate" class="add-input" placeholder="请输入本人身份证号码">
    </li>
</ul>
<input type="submit" id="submit" onclick="return realname()" class="confirm" value="提交">
</form>
</body>
</html>